interface Shape {
	double size();
}

class Rectangle implements Shape {
	private double w;
	private double h;
	Rectangle(double w, double h) {
		this.w = w;
		this.h = h;
	}
	public double size() {
		return w * h;
	}
}

class Circle implements Shape {
	private double r;
	Circle(double r) {
		this.r = r;
	}

	public double size() {
		return Math.PI * r * r;
	}
}

class Cylinder implements Shape {
	private double r;
	private double h;
	Cylinder(double r, double h) {
		this.r = r;
		this.h = h;
	}
	public double size() {
		return Math.PI * r * r * h;
	}
	
}
class Main {
	public static void main(String[] args) {
		Shape[] a = new Shape[3];
		a[0] = new Rectangle(2, 3);
		a[1] = new Circle(4);
		a[2] = new Cylinder(5, 6);

		for (int i = 0; i < 3; i++) {
			System.out.println(a[i].size());
			
		}
	}
}
